package org.example.system.controller.user;

import org.example.common.core.controller.BaseController;
import org.example.common.core.model.Result;
import org.example.common.core.model.TableDataInfo;
import org.example.system.model.user.dto.UserDTO;
import org.example.system.model.user.dto.UserQueryDTO;
import org.example.system.service.user.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author : [Pashm]
 * @version : [v1.0]
 */
@RestController
@RequestMapping("/user")
public class UserController extends BaseController {

    @Autowired
    private IUserService userService;

    @GetMapping("/list")
    public TableDataInfo list(UserQueryDTO userQueryDTO){
        return getTableDataInfo(userService.list(userQueryDTO));
    }

    @PutMapping("/updateStatus")
    //todo 拉黑：限制用户操作  解禁：放开用户限制  
    public Result<Void> updateStatus(@RequestBody UserDTO userDTO){
        return toResult(userService.updateStatus(userDTO));
    }
}
